import csv


class DataLoader:
    def __init__(self, path):
        self.data_path = path

    def loadData_csv(self):
        with open(self.data_path, 'r', encoding='gb2312') as file:
            csv_reader = csv.DictReader(file)
            # print(csv_reader.fieldnames)
            res = []
            for row in csv_reader:
                d = {}
                for k, v in row.items():
                    d[k] = v
                res.append(d)
        return res


if __name__ == '__main__':
    loader = DataLoader("./TestData/my_data.csv")
    print(loader.loadData_csv())
